#pragma once
#include <vector>
#include <functional>
#include <iostream>
#include "Log.hpp"

namespace TaskModule
{
    using namespace LogModule;

    using task_t = std::function<void()>;
    static const int tasknum = 5; /* 任务个数 */
    task_t fun1 = []()
    { LOG(LogLevel::INFO) << "下载任务..."; };
    task_t fun2 = []()
    { LOG(LogLevel::INFO) << "日志查看..."; };
    task_t fun3 = []()
    { LOG(LogLevel::INFO) << "上传任务..."; };
    task_t fun4 = []()
    { LOG(LogLevel::INFO) << "网络任务..."; };
    task_t fun5 = []()
    { LOG(LogLevel::INFO) << "通信任务..."; };

    class Task
    {
    public:
    Task()
    :_tasks(tasknum)
    {
        _tasks.emplace_back(fun1);
        _tasks.emplace_back(fun2);
        _tasks.emplace_back(fun3);
        _tasks.emplace_back(fun4);
        _tasks.emplace_back(fun5);
    }

    int Size()
    {
        return _tasks.size();
    }

    ~Task(){}
    
    std::vector<task_t> _tasks;
    };
}